# ####################################################
# Bitcount
# ####################################################

CC = mips-elf-gcc
CFLAGS = -msoft-float -specs=archc
LDFLAGS = -lm

TARGET = bitcount.x
INC_DIR := -I.

SRCS := bitcount.c bitcnt_1.c bitcnt_2.c bitcnt_3.c bitcnt_4.c bitfiles.c bitstrng.c bstr_i.c
OBJS := $(SRCS:.c=.o)

#------------------------------------------------------
.SILENT:

#------------------------------------------------------
.SUFFIXES: .o .c .h

#------------------------------------------------------
all: $(OBJS)
	$(CC) $(OBJS) $(CFLAGS) -o $(TARGET) $(LDFLAGS)
#------------------------------------------------------
clean:
	rm -f *.o *~ $(TARGET)
#------------------------------------------------------
distclean: clean
#------------------------------------------------------
bin:
	tar xzf helloworld-bin.tgz
#------------------------------------------------------
.c.o:
	$(CC) -c $(CFLAGS) $(INC_DIR) -c $<
